<template>
	<view>
		<view class="topline"></view>
		<view class="pay">
			<image src="../../static/pay(1).png" v-if="status==1" mode=""></image>
			<image src="../../static/pay(2).png" v-if="status==2" mode=""></image>
			<view class="payname">{{title}}</view>
			<view class="paybtn" @click="statusbtn()">{{btn}}</view>
			<showpayVue ref="child" :showpaymodel="showpaymodel" :from='from' :oid='oid' @showpaybtn="showpaybtn">
			</showpayVue>
		</view>
	</view>
</template>

<script>
	import showpayVue from './showpay.vue';
	export default {
		components: {
			showpayVue
		},
		data() {
			return {
				status: '',
				title: '',
				btn: '',
				oid: '',
				showpaymodel: false,
				from: ''
			}
		},
		onLoad(option) {
			this.status = option.status
			this.oid = option.oid
			this.from = option.from
			this.title = option.status == 1 ? this.$t('shop.name22') : this.$t('shop.name23')
			this.btn = option.status == 1 ? this.$t('shop.name66') : this.$t('shop.name68')
			uni.setNavigationBarTitle({
				title: this.title
			})
		},
		methods: {
			showpaybtn(showpaymodel) {
				this.showpaymodel = showpaymodel
				this.zIndex = 10075
			},
			statusbtn() {
				if (this.status == 1) {
					uni.redirectTo({
						url: '/pageA/order/order?state=0'
					})
				} else {
					uni.showLoading({
						title: '',
					})
					setTimeout(() => {
						uni.hideLoading()
						this.showpaymodel = true
						this.$refs.child.getorder(this.oid);
					}, 1000)
				}
			}
		}
	}
</script>

<style lang="scss">
	.topline {
		width: 750rpx;
		height: 2rpx;
		background: #EAEAEA;
	}

	.pay {
		text-align: center;
		margin-top: 160rpx;

		image {
			width: 160rpx;
			height: 160rpx;
		}

		.payname {
			font-weight: 600;
			font-size: 36rpx;
			color: #19181A;
			margin-top: 30rpx;
			margin-bottom: 90rpx;
		}

		.paybtn {
			width: 360rpx;
			height: 72rpx;
			line-height: 72rpx;
			text-align: center;
			border-radius: 36rpx;
			border: 2rpx solid #FB6C04;
			font-weight: 500;
			font-size: 28rpx;
			color: #FB6C04;
			margin: 0 auto;
		}
	}
</style>